package vn.cent.game.cardtype.client;

import java.util.List;
import java.util.Map.Entry;

import vn.cent.game.cardtype.beans.GameBean;
import vn.cent.game.cardtype.main.CardTypeGameExtension;

import com.smartfoxserver.v2.entities.Room;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.extensions.BaseClientRequestHandler;


/// This class use to check if player already join to room
/// and already finish loading game UI and waiting for response 
/// from server after push a MAKE_READY command to server
/// In server side, we take a quick check to make sure 
/// all players are ready and let's game start 
public class MakeStart extends BaseClientRequestHandler{

	@Override
	public void handleClientRequest(User user /* isHost == true*/, ISFSObject data) {
		/*CardTypeGameExtension gameExtension = (CardTypeGameExtension) getParentExtension();
		
		byte gameKind = data.getByte("GameType");
		byte numberOfPlayer = data.getByte("PlayerQuantity");
		int roomID = data.getInt("RoomID");
		*/
		/*
		Room abc = user.getLastJoinedRoom();
		List<User> listPlayer = abc.getPlayersList();
		
		int time = data.getInt("TimeCountDown");
		
		ISFSObject data = new SFSObject();
		
		data.putUtfString("StartGame", "BatDauDuocRoai");
		data.putInt("TimeCountDown", time);
		
		
		send("StartGame", data, listPlayer);
		*/
		
		// Get data from client push to server
		
		
	}
/*
	
	private List<User> GetListPlayerBaseRoomID(GameBean game, int RoomID)
	{
		
		for (Entry<Integer, User> interable_element : game.getPlayers().entrySet())
		{
			User specificUser = interable_element.getValue();
			//if ()
		}*
		return null;
	}*/
	
}
